package com.hmsm.sys.bean;

public enum DeptRangeEnum {
	UNLIMITED(0, "不限"), DIRECT(1, "直属的"), INCLUDE(2, "所属的");   

    private int value;
    
    public int getValue() {
		return value;
	}

	private String displayName; 
    
    public String getDisplayName() {
		return displayName;
	}

	private DeptRangeEnum(int value, String displayName) {    //    必须是private的，否则编译错误
        this.value = value;
        this.displayName = displayName;
    }

    public static DeptRangeEnum valueOf(int value) {    //    手写的从int到enum的转换函数
        switch (value) {
        case 0:
            return UNLIMITED;
        case 1:
            return DIRECT;
        case 2:
            return INCLUDE;
        default:
            return null;
        }
    }

    public int value() {
        return this.value;
    }

}
